package edu.sctu.zhoudie.mouth201505.day20150529.others;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by user08 on 2015/5/29.
 */
public class TextMore {
    public List<Teacher> sotrNumber(){
        MyTeacher teacher = new MyTeacher();
        List<Teacher> list = teacher.tea();





        for (int i = 0; i < list.size()-1; i++) {

            for (int j = 0; j < list.size()-1; j++) {

                if (list.get(j).getNumber()>list.get(j+1).getNumber()) {

                    list.add(j, list.get(j + 1));

                    list.remove(j+2);



                }
            }
        }

        System.out.println("1111");
        return list;

    }

    public List<Student> sortStudent(){
        MyTeacher teacher1 = new MyTeacher();
        List<Teacher> list = teacher1.tea();

        List<Student> list1 = new ArrayList<>();

        for (int i = 0; i < list.size(); i++) {
            for (int j = 0; j < list.get(i).getStudent().size(); j++) {
                list1.add(list.get(i).getStudent().get(j));
            }
        }


        return list1;

    }

    public List<Teacher> pritCoded(){
        MyTeacher teacher2 = new MyTeacher();

        List<Teacher> list = teacher2.tea();
        List<Teacher> list1 = new ArrayList<>();


        for (int i = 0; i < list.size(); i++) {

            if (list.get(i).getTitle().equals("教授")){

                list1.add(list.get(i));
            }
        }

        return list1;

    }
}
